Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Lotus Expeditor wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL forums and blogs
  • Home
  • Product Documentation
  • Community Articles
Search
Community Articles > Expeditor Client for Desktop > Sample: Disabling Expeditor Activities
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Sample: Toolbar and Menu Contributions

Expeditor user interface team best practices on toolbar and menu contributions

Sample: Component Properties

OverviewComponent properties allow developers to create code that at compile time has specific function but accepts flexible input at runtime. For example, a developer can create a component that uses a predefined component property to update the title tab's text within a composite ...

Sample: Multiuser Features

Overview When multiple users share the same workstation, the configuration is referred to as a multiuser installation. This means that a single Expeditor client exists and is shared among all users; however, each user has their own workspace containing configuration details specific to that ...

Sample: Starting Plugins

Overview By default, Eclipse plugins are lazy. Lazy is the technical term (located in the bundle's manifest) that means that plugins are started when a request is either directly made by the Platform to start the plugin or indirectly through class loading. For example, the latter case implies ...

Sample: HTTP Communication

Overview The enhanced HTTP client in Expeditor allows developers to quickly create code that requests data from remote servers over HTTP or HTTPS. The enhanced client wraps the standard Java URLConnectionclasses such that authenticated requests leverage the Accounts framework and HTTPS ...
Community articleSample: Disabling Expeditor Activities
Added by ~Tip Desachekli on February 15, 2011 | Version 1
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: samples
ShowTable of Contents
HideTable of Contents
  • 1 Overview
  • 2 An Example
  • 3 Removing the Menu Items
  • 4 Ensuring the Menu Items Remain Hidden

Overview


Lotus Expeditor Client for Desktop uses Eclipse Activities (org.eclipse.ui.activities) to dynamically add an remove items from the user interface. Actions such as menu items or tool bar can be grouped together under a single activity ID. When the activity does not apply to the current state of the screen, the activity can be disabled thereby removing the actions from the user interface.

An Example


When composite applications are opened within Expeditor, you'll notice two file actions are added to the menu bar: Make Available Offline... and Membership. If you were to open another perspective that is not a composite application, these two items would be removed from the menu bar. The act of switching between a composite application perspective either enables or disables the activity that controls these two menu items.



Removing the Menu Items


To remove the menu items, code simply disables the activity that groups the two items.

String id = "com.ibm.rcp.http.composite.application.activity";

IWorkbenchActivitySupport s = PlatformUI.getWorkbench()
		.getActivitySupport();
IActivityManager m = s.getActivityManager();

IActivity a = m.getActivity(id);

if (a != null) {
	// remove the activity
	Set enabled = new HashSet(m.getEnabledActivityIds());
	enabled.remove(id);
	
	s.setEnabledActivityIds(enabled);
}


The getEnabledActivityIds function can be used to inspect the current list of activities enabled. It may provide a starting point to understand what actions are contributed under the activity and whether disabling the activity yields the desired customization.

Ensuring the Menu Items Remain Hidden


As with other wiki article samples, certain actions within Expeditor can re-add previously removed customization. Earlier in the article, it was mentioned that switching to a composite application perspective enables the activity and thus adds the menu items. To ensure the menu items remain hidden, a perspective listener can be used to always disable the activity when a perspective is used. The listener is created and added via Eclipse's IStartup extension point (org.eclipse.ui.startup).

public void earlyStartup() {
// always disable the File menu options for
// Membership
// Make available offline	Display.getDefault().asyncExec(new Runnable() {

		@Override
		public void run() {
			PlatformUI.getWorkbench().getActiveWorkbenchWindow()
					.addPerspectiveListener(new PerspectiveAdapter() {

					@Override
					public void perspectiveActivated(
							IWorkbenchPage page,
							IPerspectiveDescriptor desc) {
						disableCaiActivity();
					}

					@Override
					public void perspectiveChanged(IWorkbenchPage arg0,
IPerspectiveDescriptor arg1, String arg2) { }
				});
			}
		});
	}


  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (1)Feb 15, 2011, 4:50:30 PM~Tip Desachekli  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software Support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility